﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGePlanarEnt : OdGeSurface
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGePlanarEnt(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGePlanarEnt_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGePlanarEnt obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGePlanarEnt()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGePlanarEnt(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public bool intersectWith(OdGeLinearEnt3d line, OdGePoint3d point, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGePlanarEnt_intersectWith__SWIG_0(this.swigCPtr, OdGeLinearEnt3d.getCPtr(line), OdGePoint3d.getCPtr(point), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGeLinearEnt3d line, OdGePoint3d point)
		{
			bool result = GlobalsPINVOKE.OdGePlanarEnt_intersectWith__SWIG_1(this.swigCPtr, OdGeLinearEnt3d.getCPtr(line), OdGePoint3d.getCPtr(point));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d closestPointToLinearEnt(OdGeLinearEnt3d line, OdGePoint3d pointOnLine, OdGeTol tol)
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGePlanarEnt_closestPointToLinearEnt__SWIG_0(this.swigCPtr, OdGeLinearEnt3d.getCPtr(line), OdGePoint3d.getCPtr(pointOnLine), OdGeTol.getCPtr(tol)), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d closestPointToLinearEnt(OdGeLinearEnt3d line, OdGePoint3d pointOnLine)
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGePlanarEnt_closestPointToLinearEnt__SWIG_1(this.swigCPtr, OdGeLinearEnt3d.getCPtr(line), OdGePoint3d.getCPtr(pointOnLine)), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d closestPointToPlanarEnt(OdGePlanarEnt plane, OdGePoint3d pointOnOtherPlane, OdGeTol tol)
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGePlanarEnt_closestPointToPlanarEnt__SWIG_0(this.swigCPtr, OdGePlanarEnt.getCPtr(plane), OdGePoint3d.getCPtr(pointOnOtherPlane), OdGeTol.getCPtr(tol)), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d closestPointToPlanarEnt(OdGePlanarEnt plane, OdGePoint3d pointOnOtherPlane)
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGePlanarEnt_closestPointToPlanarEnt__SWIG_1(this.swigCPtr, OdGePlanarEnt.getCPtr(plane), OdGePoint3d.getCPtr(pointOnOtherPlane)), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isParallelTo(OdGeLinearEnt3d line, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGePlanarEnt_isParallelTo__SWIG_0(this.swigCPtr, OdGeLinearEnt3d.getCPtr(line), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isParallelTo(OdGeLinearEnt3d line)
		{
			bool result = GlobalsPINVOKE.OdGePlanarEnt_isParallelTo__SWIG_1(this.swigCPtr, OdGeLinearEnt3d.getCPtr(line));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isParallelTo(OdGePlanarEnt plane, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGePlanarEnt_isParallelTo__SWIG_2(this.swigCPtr, OdGePlanarEnt.getCPtr(plane), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isParallelTo(OdGePlanarEnt plane)
		{
			bool result = GlobalsPINVOKE.OdGePlanarEnt_isParallelTo__SWIG_3(this.swigCPtr, OdGePlanarEnt.getCPtr(plane));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isPerpendicularTo(OdGeLinearEnt3d line, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGePlanarEnt_isPerpendicularTo__SWIG_0(this.swigCPtr, OdGeLinearEnt3d.getCPtr(line), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isPerpendicularTo(OdGeLinearEnt3d line)
		{
			bool result = GlobalsPINVOKE.OdGePlanarEnt_isPerpendicularTo__SWIG_1(this.swigCPtr, OdGeLinearEnt3d.getCPtr(line));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isPerpendicularTo(OdGePlanarEnt plane, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGePlanarEnt_isPerpendicularTo__SWIG_2(this.swigCPtr, OdGePlanarEnt.getCPtr(plane), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isPerpendicularTo(OdGePlanarEnt plane)
		{
			bool result = GlobalsPINVOKE.OdGePlanarEnt_isPerpendicularTo__SWIG_3(this.swigCPtr, OdGePlanarEnt.getCPtr(plane));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isCoplanarTo(OdGePlanarEnt plane, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGePlanarEnt_isCoplanarTo__SWIG_0(this.swigCPtr, OdGePlanarEnt.getCPtr(plane), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isCoplanarTo(OdGePlanarEnt plane)
		{
			bool result = GlobalsPINVOKE.OdGePlanarEnt_isCoplanarTo__SWIG_1(this.swigCPtr, OdGePlanarEnt.getCPtr(plane));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void get(OdGePoint3d origin, OdGeVector3d uAxis, OdGeVector3d vAxis)
		{
			GlobalsPINVOKE.OdGePlanarEnt_get__SWIG_0(this.swigCPtr, OdGePoint3d.getCPtr(origin), OdGeVector3d.getCPtr(uAxis), OdGeVector3d.getCPtr(vAxis));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void get(OdGePoint3d uPnt, OdGePoint3d origin, OdGePoint3d vPnt)
		{
			GlobalsPINVOKE.OdGePlanarEnt_get__SWIG_1(this.swigCPtr, OdGePoint3d.getCPtr(uPnt), OdGePoint3d.getCPtr(origin), OdGePoint3d.getCPtr(vPnt));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGePoint3d pointOnPlane()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGePlanarEnt_pointOnPlane(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector3d normal()
		{
			OdGeVector3d result = new OdGeVector3d(GlobalsPINVOKE.OdGePlanarEnt_normal(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getCoefficients(out double a, out double b, out double c, out double d)
		{
			GlobalsPINVOKE.OdGePlanarEnt_getCoefficients(this.swigCPtr, out a, out b, out c, out d);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getCoordSystem(OdGePoint3d origin, OdGeVector3d axis1, OdGeVector3d axis2)
		{
			GlobalsPINVOKE.OdGePlanarEnt_getCoordSystem(this.swigCPtr, OdGePoint3d.getCPtr(origin), OdGeVector3d.getCPtr(axis1), OdGeVector3d.getCPtr(axis2));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGePlanarEnt Assign(OdGePlanarEnt plane)
		{
			OdGePlanarEnt result = new OdGePlanarEnt(GlobalsPINVOKE.OdGePlanarEnt_Assign(this.swigCPtr, OdGePlanarEnt.getCPtr(plane)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool project(OdGePoint3d p, OdGeVector3d unitDir, OdGePoint3d projP, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGePlanarEnt_project__SWIG_0(this.swigCPtr, OdGePoint3d.getCPtr(p), OdGeVector3d.getCPtr(unitDir), OdGePoint3d.getCPtr(projP), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool project(OdGePoint3d p, OdGeVector3d unitDir, OdGePoint3d projP)
		{
			bool result = GlobalsPINVOKE.OdGePlanarEnt_project__SWIG_1(this.swigCPtr, OdGePoint3d.getCPtr(p), OdGeVector3d.getCPtr(unitDir), OdGePoint3d.getCPtr(projP));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
